Skip to content

feat: add is_deleted soft-delete to ClickHouse IDENTITIES table#7710

Open
10done wants to merge 7 commits into
Flagsmith:mainfrom
10done:feat/clickhouse-identities-is-deleted
Open

feat: add is_deleted soft-delete to ClickHouse IDENTITIES table#7710
10done wants to merge 7 commits into
Flagsmith:mainfrom
10done:feat/clickhouse-identities-is-deleted

Conversation

@10done
Copy link
Copy Markdown
Contributor

@10done 10done commented Jun 5, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Fixes #7593

  • Added is_deleted Bool DEFAULT false column to the ClickHouse IDENTITIES table via a new migration
  • Extended the mapper and INSERT column list to carry is_deleted on every backfill row (defaults to false)
  • Added write_identity_deletion_tombstone_to_clickhouse async task, dispatched from EdgeIdentity.delete() to tombstone deleted identities in real time
  • Added AND i.is_deleted = false to the segment membership count query so deleted identities never appear in counts

How did you test this code?

Screenshot 2026-06-05 at 5 01 43 AM DESCRIBE TABLE IDENTITIES` confirms `is_deleted Bool DEFAULT false` column exists after migration Screenshot 2026-06-05 at 5 03 35 AM Inserted a live row (`alice`) and a tombstone (`bob`); query with `WHERE is_deleted = false` returns only `alice` Screenshot 2026-06-05 at 5 07 03 AM Python assertions confirm `services.py` has the `is_deleted = false` filter and `tasks.py` has the correct INSERT column list and SQL

@10done 10done requested a review from a team as a code owner June 5, 2026 00:00
@10done 10done requested review from emyller and removed request for a team June 5, 2026 00:00
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

@10done is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the api Issue related to the REST API label Jun 5, 2026
@10done 10done requested a review from a team as a code owner June 5, 2026 01:19
@github-actions github-actions Bot added the docs Documentation updates label Jun 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.37%. Comparing base (cbcac64) to head (01e0e80).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7710      +/-   ##
==========================================
- Coverage   98.52%   98.37%   -0.16%     
==========================================
  Files        1444     1445       +1     
  Lines       54971    55027      +56     
==========================================
- Hits        54161    54133      -28     
- Misses        810      894      +84     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle is_deleted attribute when querying for identities in ClickHouse

2 participants